from google.appengine.ext import db
from datetime import datetime

class Matching(db.Model):
  name = db.StringProperty()
  startDate = db.DateTimeProperty(auto_now=True)
  endDate = db.DateTimeProperty(auto_now=True)

  def timeToClose(self):
  	print 'params'
  	print str(self.endDate)
  	print str(datetime.now())
  	print 'params'
  	delta = self.endDate - datetime.now()  	
  	if (delta.days < 0): 
  		return 'Time up!'
  	else: 
  		return str(delta)